<template>
  <view>
    <view class="u-text-center u-font-40">{{ count }}</view>
    <view class="u-flex">
      <button @click="handleSetCount(1)">+</button>
      <button @click="handleSetCount(-1)">-</button>
    </view>
  </view>
</template>

<script>
export default {
  computed: {
    count() {
      return this.$store.state.count;
    },
  },
  methods: {
    handleSetCount(num) {
      this.$store.commit("setCount", num);
    },
  },
};
</script>

<style></style>
